package com.csun.cmny.provider.model.dto.watch;

import com.csun.cmny.provider.model.domain.DmcWatchSafetyRange;
import com.csun.cmny.provider.validator.DmcWatchAlarmClockAddValidator;
import com.csun.cmny.provider.validator.DmcWatchAlarmClockEditValidator;
import com.csun.cmny.provider.validator.DmcWatchSafetyRangeAddValidator;
import com.csun.cmny.provider.validator.DmcWatchSafetyRangeEditValidator;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.persistence.Column;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * @Auther: chisj chisj@foxmal.com
 * @Date: 2019-01-27 15:08
 * @Description: the class watch safety range dto
 */
@Data
@ApiModel(value = "添加孝心手环安全区域Dto")
public class WatchSafetyRangeDto implements Serializable {

    private static final long serialVersionUID = -2345216715635626861L;

    /**
     * 安全区域Id
     */
    @NotNull(message = "{watch.safety.range.id.null}",
            groups = {DmcWatchSafetyRangeEditValidator.class})
    private Long id;

    /**
     * 设备Id
     */
    @NotNull(message = "{device.id.null}",
            groups = {DmcWatchSafetyRangeAddValidator.class})
    private Long deviceId;

    /**
     * 名称
     */
    @NotNull(message = "{watch.safety.range.name.null}",
            groups = {DmcWatchSafetyRangeAddValidator.class})
    @NotEmpty(message = "{watch.safety.range.name.null}",
            groups = {DmcWatchSafetyRangeAddValidator.class})
    private String name;

    /**
     * 开关 0-关 1-开
     */
    @NotNull(message = "{watch.safety.range.is.open.null}",
            groups = {DmcWatchSafetyRangeAddValidator.class})
    @Range(min = 0, max = 1, message = "watch.safety.range.is.open.range",
            groups = {DmcWatchSafetyRangeAddValidator.class})
    private Integer isOpen;

    /**
     * 报警方式 0-进出 1-出去 2-进入
     */
    @NotNull(message = "{watch.safety.range.alert.way.null}",
            groups = {DmcWatchSafetyRangeAddValidator.class})
    @Range(min = 0, max = 2, message = "watch.safety.range.alert.way.range",
            groups = {DmcWatchSafetyRangeAddValidator.class})
    private Integer alertWay;

    /**
     * gps位置 纬度值|经度值
     */
    @NotNull(message = "{watch.safety.range.gps.null}",
            groups = {DmcWatchSafetyRangeAddValidator.class})
    @NotEmpty(message = "{watch.safety.range.gps.null}",
            groups = {DmcWatchSafetyRangeAddValidator.class})
    private String gpsString;

    /**
     * 位置
     */
    @NotNull(message = "{watch.safety.range.location.null}",
            groups = {DmcWatchSafetyRangeAddValidator.class})
    @NotEmpty(message = "{watch.safety.range.location.null}",
            groups = {DmcWatchSafetyRangeAddValidator.class})
    private String location;

    /**
     * 安全区域
     */
    @NotNull(message = "{watch.safety.range.null}",
            groups = {DmcWatchSafetyRangeAddValidator.class})
    @Range(min = 100, message = "watch.safety.range.error",
            groups = {DmcWatchSafetyRangeAddValidator.class})
    private Integer safetyRange;

}
